﻿using NETCORE.MysqlBinLog.BoundEnum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NETCORE.MysqlBinLog.Bound
{
    internal static class Express
    {
        public static string GetEnumValue<T>(this string str) where T : struct, IComparable, IFormattable, IConvertible
        {
            var enumArr = EnumAssist.EnumValues<T>();

            var code = int.Parse(str.Trim().TrimStart('@')) - 1;

            return enumArr[code].ToString();
        }
    }
}
